import axios from 'axios'
import qs from 'qs'
export default function(config){
         const instance  = axios.create({
            baseURL:'https://www.xmssj.com/dl',
            //     baseURL:"http://192.168.3.216:8080"
    })
    instance.interceptors.request.use(config=>{
        if(config.method=='post'&&!config.type){
        config.headers={
                'Content-type':" application/x-www-form-urlencoded"
            }
            config.data=qs.stringify(config.data)
        }

        return config
    })
    instance.interceptors.response.use(config=>{
        return config.data
    })
    return instance(config)
}